import 'package:flutter/material.dart';
import 'package:yqys_target/gen/assets.gen.dart';
import 'package:yqys_target/widgets/charity_list_item.dart';

class MyCharityPage extends StatelessWidget {
  const MyCharityPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.grey[100],
      appBar: AppBar(
        backgroundColor: Colors.white,
        elevation: 0,
        title: const Text(
          '我的益事',
          style: TextStyle(
            color: Colors.black,
            fontSize: 20,
            fontWeight: FontWeight.bold,
          ),
        ),
        leading: IconButton(
          icon: const Icon(Icons.arrow_back_ios, color: Colors.black),
          onPressed: () => Navigator.of(context).pop(),
        ),
      ),
      body: ListView.builder(
        padding: const EdgeInsets.all(16),
        itemCount: 10, // 示例数据数量
        itemBuilder: (context, index) {
          return CharityAndCredentialListItem(
            title: '乡村留守儿童免费午餐',
            type: CharityAndCredentialType.myCharity,
            status: MyCharityStatus.values[index % 4], // 循环展示不同状态
            imageUrl: Assets.images.project1.path,
            onTap: () {
              // TODO: 处理点击事件
            },
          );
        },
      ),
    );
  }
} 